<extend name="Public/base" />
<block name="content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="{:U('Index/index')}" data-original-title="首页"><i class="icon-home"></i> 首页</a>
			<a class="tip-bottom" href="{:U('Activity/index')}" data-original-title="">活动管理</a> <a class="current" href="{$post_url}">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br/>
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i>
						</span>
						<h5>{$meta_title}</h5>
					</div>
					<div class="widget-content nopadding">
						<form class="form-horizontal" method="post" action="">
							<div class="control-group">
								<label class="control-label">活动类型:</label>
								<div class="controls">
									<select class="form-control span2" name="activity_category_id" >
										<volist name="category_list" id="vo">
											<option value="{$vo.activity_category_id}" <if condition="$vo['activity_category_id'] eq $list['activity_category_id']"> selected</if> >{$vo.category_name}</option>
										</volist>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">线上/线下活动:</label>
								<div class="controls">
									<select class="form-control span2" name="is_online" <notempty name="list">disabled</notempty>>
											<option value="1">线上活动</option>
											<option value="0">线下活动</option>
									</select>
								</div>
							</div>
							<notempty name="theme_list">
								<div class="control-group">
									<label class="control-label">模板继承:</label>
									<div class="controls">
										<select class="form-control span2" name="activity_theme_id">
											<option value="0">请选择模板</option>
											<volist name="theme_list" id="vo">
												<option value="{$vo.activity_theme_id}">{$vo.theme_name}</option>
											</volist>
										</select>
									</div>
								</div>
							</notempty>
							<div class="control-group">
								<label class="control-label">活动名称:</label>
								<div class="controls">
									<input type="text" placeholder="活动名称" class="ui-wizard-content span2" name="activity_name" value="{$list.activity_name|htmlspecialchars}" >
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">开始日期 :</label>
								<div class="controls">
									<input type="text" placeholder="开始日期" class="ui-wizard-content datepicker span2" name="start_time"  value='<neq name="list.start_time" value="">{:time_format($list["start_time"],"Y-m-d H:i")}</neq>' >
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">结束日期 :</label>
								<div class="controls">
									<input type="text" placeholder="结束日期" class="ui-wizard-content datepicker span2" name="end_time" value='<neq name="list.end_time" value="">{:time_format($list["end_time"],"Y-m-d H:i")}</neq>' >
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">系统上线日期:</label>
								<div class="controls">
									<input type="text" placeholder="系统上线日期" class="ui-wizard-content datepicker span2" name="show_start_time" value='<neq name="list.show_start_time" value="">{:time_format($list["show_start_time"],"Y-m-d H:i")}</neq>' >
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">系统下线日期 :</label>
								<div class="controls">
									<input type="text" placeholder="系统下线日期" class="ui-wizard-content datepicker span2" name="show_end_time" value='<neq name="list.show_end_time" value="">{:time_format($list["show_end_time"],"Y-m-d H:i")}</neq>' >
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">预计报名人数 :</label>
								<div class="controls">
									<input type="text" placeholder="预计报名人数" class="ui-wizard-content span2" name="expect_member_num" value="{$list.expect_member_num}" onkeyup="value=value.replace(/[a-zA-z]+$/,'')" >
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">预计收入:</label>
								<div class="controls">
									<input type="text" placeholder="预计收入" class="ui-wizard-content span2" name="expect_money" value="{$list.expect_money}" onkeyup="value=value.replace(/[a-zA-z]+$/,'')">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">短信发送内容:</label>
								<div class="controls">
									<textarea name="sms_content"  placeholder="短信发送内容" class="span7" maxlength="80">{$list.sms_content}</textarea>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">使用默认活动模版:</label>
								<div class="controls" style="margin-top:5px;">
									<label><input type="radio" name="is_template" value="0" checked>否</label>
							  		<label><input type="radio" name="is_template" value="1">是</label>
						  		</div>
							</div>
							
							<div class="form-actions">
								<button class="btn btn-success" type="submit">提交</button>
							</div>
							<input type="hidden" name="activity_id" value="{$list.activity_id}"/>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	
	set_value("activity_category_id","{:I('activity_category_id','')}");
	set_value("is_online","{$list.is_online}");
	//日期控件
	$(".datepicker").datetimepicker({
		format: 'yyyy-mm-dd hh:ii', 
	 	//weekStart: 1, 
	 	startDate:new Date(), //开始时间，在这时间之前都不可选
		//endDate:'+1',//结束时间，在这时间之后都不可选
	    autoclose: true,
	    todayBtn: true
	});
	
	//初始化登录用户名输入焦点
	tke_form_focus();
	$("form").submit(function(){
		//锁定登录按钮
		$('button').attr('disabled',true);
		var self = $(this);
		$.post("{$post_url}", self.serialize(), call_back, "json");
		return false;
		
		/**
		 * @todo 接收登录返回值
		 * @author PHP@妖孽 <dino_ma@163.com>
		 */
		function call_back(data){
			if(data.status==1){
				tke_alert(data.info,'alert-success');
				setTimeout(function(){
				  if (data.url) {
						location.href=data.url;
					}else{
						location.reload();
					}
				},1500);
			} else {
				$('button').attr('disabled',false);
				tke_alert(data.info,'alert-error');
			}
		}
	});
	//导航高亮
	highlight_subnav("{:U('Activity/index')}");
});
</script>
</block>